package com.example;


import android.app.Application;

import com.example.utils.FileUtils;
import com.lidroid.xutils.bitmap.BitmapGlobalConfig;
import com.lidroid.xutils.cache.MD5FileNameGenerator;


public class BaseApp extends Application {

    private static BaseApp app;

    @Override
    public void onCreate() {
        super.onCreate();
        app = this;
        configGlobalBitmap();
    }

    public static BaseApp getInstance() {
        return app;
    }


    private void configGlobalBitmap() {

        BitmapGlobalConfig config = BitmapGlobalConfig.getInstance(this, FileUtils.getImageCache());
        config.setDefaultCacheExpiry(1000L * 60 * 60 * 24 * 30 * 12 * 100);

        config.setMemoryCacheSize(8 * 1024 * 1024);
        config.setDiskCacheSize(1024 * 1024 * 100);
        config.setThreadPoolSize(4);
        config.setFileNameGenerator(new MD5FileNameGenerator());

    }


}
